package com.baozhun.mall.common.provider

import androidx.databinding.DataBindingUtil
import com.baozhun.mall.common.R
import com.baozhun.mall.common.databinding.ItemCommonGoodsBinding
import com.baozhun.mall.common.model.bean.GoodsInfoBean
import com.baozhun.mall.common.model.enums.HomeCategoryItemType
import com.chad.library.adapter.base.provider.BaseItemProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @Title：渠道商品Provider
 * @Description：
 * @Author：xing.luo
 * @Since：2022/11/09
 * @Version：1.0.0
 */
class ChannelGoodsProvider : BaseItemProvider<GoodsInfoBean>() {

    override val itemViewType: Int
        get() = HomeCategoryItemType.CHANNEL_GOODS.type

    override val layoutId: Int
        get() = R.layout.item_common_goods

    override fun convert(helper: BaseViewHolder, item: GoodsInfoBean) {
        val dataBinding: ItemCommonGoodsBinding? = DataBindingUtil.bind(helper.itemView)
        dataBinding?.model = item
    }
}